package genhandle

import (
	"fginTpl/fgin_grpc_gen/config"
	"fginTpl/fgin_grpc_gen/globals"
	"fginTpl/utils"
	"path/filepath"
)

// 生成服务方法
func GenServices() {
	tplParams := map[string]string{
		"ProjectName": config.ConfigData.ProjectName,
		"Port":        config.ConfigData.Port,
		"PrjPascal":   utils.SnakeToPascal(config.ConfigData.ProjectName),
	}
	// example 例子
	if err := utils.TourchFile(filepath.Join(globals.BASEDIR, "./services/"+config.ConfigData.ProjectName+"_service.go"), "./fgin_grpc_templates/services/example_service.tpl", "exampleServicesGoTpl", tplParams); err != nil {
		panic(err)
	}
}
